﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DoAnTriTueNhanTao
{
    class MyPoint
    {
        Sprite sprite;
        int x;
        int y;
        int width;
        int height;

        private int _heuristic;

        public int heuristic
        {
            get { return _heuristic; }
            set { _heuristic = value; }
        }
        public MyPoint(int _x, int _y)
        {
            sprite = new Sprite(Properties.Resources.circlergb, 50, 50);
            x = _x;
            y = _y;
            width = 50;
            height = 50;
            sprite.setPosition(x, y);
        }

        public void Draw(Graphics g)
        {
            sprite.Draw(g);
            Font font = new Font("Arial", 12);
            SolidBrush brush = new SolidBrush(Color.FromArgb(0, 0, 0));
            g.DrawString("h = " + heuristic, font, brush, sprite.getX() - 22, sprite.getY() - 34);
        }

        public void DrawIndex(Graphics g, int idx)
        {
            Font font = new Font("Arial", 12);
            SolidBrush brush = new SolidBrush(Color.FromArgb(255, 255, 255));
            g.DrawString(idx.ToString(), font, brush, sprite.getX() - 10, sprite.getY() - 8);
        }
        public int getX()
        {
            return sprite.getX();
        }
        public int getY()
        {
            return sprite.getY();
        }

        public bool isClicked(int x, int y)
        {
            return sprite.isClicked(x, y);
        }
        public void setPosition(int x, int y)
        {
            sprite.setPosition(x, y);
        }
    }
}
